﻿@model MaterialPurchase
@{
    Layout = "~/Views/Shared/_LayoutFormDetail.cshtml";
    ViewBag.SaveAction = "Storage";
}
@section Up{
    @Html.HiddenFor(model => model.Id)
    @Html.HiddenFor(model => model.State)
    @Html.HiddenFor(model => model.OrderDate)
    @Html.nbDropDownListFor(model => model.SupplierId, "Supplier").Required()
    @Html.nbTextBoxFor(model => model.TotalAmount).ReadOnly()
    @Html.nbDateFor(model => model.Date)
}
@section Down{
    @(Html.nbDetailFor<MaterialPurchaseItem>(s =>
    {
        s.layoutW(10);
        s.layoutH(162);
        s.Columns(c =>
        {
            c.Bind(m => m.Id).IsKey();
            c.Bind(m => m.MaterialId).Hide();
            c.BindEnum(m => m.Category, "MaterialCategory").Width(50);
            c.Bind(m => m.Code).Width(60);
            c.Bind(m => m.Name).Width(100).Align(GridAlign.Left);
            c.Bind(m => m.Price).Width(50).Align(GridAlign.Right);
            c.BindEnum(m => m.Unit, "MaterialUnit").Title("单位").Width(30);
            c.Bind(m => m.OrderCount).Width(50).Align(GridAlign.Right);
            c.BindControl(m => m.StorageCount).Width(50).Align(GridAlign.Right);
            c.Bind(m => m.Amount).Width(50).Title("金额").Align(GridAlign.Right);
        });
    }))
}
